package com.core.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.core.dao.GenericDao;
import com.core.entity.DomainObject;

public interface GenericService<E extends DomainObject, PK extends Serializable> {

	GenericDao<E, PK> getDao();
	
	PK save(E entity) throws Exception;

	void update(E transientObject) throws Exception;

	void saveOrUpdate(E transientObject) throws Exception;

	void delete(E persistentObject) throws Exception;

	E find(PK id) throws Exception;

	List<E> findAll() throws Exception;

	List<E> findAllByProperty(String propertyName, Object value)
			throws Exception;
}
